.class Lcom/waiqin365/lightapp/kehu/ap;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;


# instance fields
.field final synthetic a:Ljava/util/ArrayList;

.field final synthetic b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;


# direct methods
.method constructor <init>(Lcom/waiqin365/lightapp/kehu/CMContactActivity;Ljava/util/ArrayList;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    iput-object p2, p0, Lcom/waiqin365/lightapp/kehu/ap;->a:Ljava/util/ArrayList;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 4

    iget-object v0, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->a(Lcom/waiqin365/lightapp/kehu/CMContactActivity;)Landroid/widget/PopupWindow;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->a(Lcom/waiqin365/lightapp/kehu/CMContactActivity;)Landroid/widget/PopupWindow;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/PopupWindow;->dismiss()V

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/kehu/ap;->a:Ljava/util/ArrayList;

    invoke-virtual {v0, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    iget-object v1, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    invoke-static {v1}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->b(Lcom/waiqin365/lightapp/kehu/CMContactActivity;)[Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    aget-object v1, v1, v2

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    const-class v2, Lcom/waiqin365/lightapp/kehu/CMAddNewContactActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    new-instance v1, Landroid/os/Bundle;

    invoke-direct {v1}, Landroid/os/Bundle;-><init>()V

    const-string/jumbo v2, "cmId"

    iget-object v3, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    invoke-static {v3}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->c(Lcom/waiqin365/lightapp/kehu/CMContactActivity;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string/jumbo v2, "comefrom"

    iget-object v3, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    invoke-static {v3}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->d(Lcom/waiqin365/lightapp/kehu/CMContactActivity;)I

    move-result v3

    invoke-virtual {v1, v2, v3}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    const-string/jumbo v2, "linkmanConfig"

    iget-object v3, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    invoke-static {v3}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->e(Lcom/waiqin365/lightapp/kehu/CMContactActivity;)Ljava/util/ArrayList;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/os/Bundle;->putSerializable(Ljava/lang/String;Ljava/io/Serializable;)V

    iget-object v2, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    invoke-static {v2}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->f(Lcom/waiqin365/lightapp/kehu/CMContactActivity;)Ljava/util/ArrayList;

    move-result-object v2

    if-eqz v2, :cond_2

    iget-object v2, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    invoke-static {v2}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->f(Lcom/waiqin365/lightapp/kehu/CMContactActivity;)Ljava/util/ArrayList;

    move-result-object v2

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    if-lez v2, :cond_2

    const-string/jumbo v2, "is_main"

    const-string/jumbo v3, "0"

    invoke-virtual {v1, v2, v3}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    :goto_0
    invoke-virtual {v0, v1}, Landroid/content/Intent;->putExtras(Landroid/os/Bundle;)Landroid/content/Intent;

    iget-object v1, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    const/16 v2, 0x68

    invoke-virtual {v1, v0, v2}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->startActivityForResult(Landroid/content/Intent;I)V

    :cond_1
    :goto_1
    return-void

    :cond_2
    const-string/jumbo v2, "is_main"

    const-string/jumbo v3, "1"

    invoke-virtual {v1, v2, v3}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    :cond_3
    iget-object v1, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    invoke-static {v1}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->b(Lcom/waiqin365/lightapp/kehu/CMContactActivity;)[Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x1

    aget-object v1, v1, v2

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    new-instance v0, Landroid/content/Intent;

    const-string/jumbo v1, "android.intent.action.PICK"

    sget-object v2, Landroid/provider/ContactsContract$Contacts;->CONTENT_URI:Landroid/net/Uri;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    iget-object v1, p0, Lcom/waiqin365/lightapp/kehu/ap;->b:Lcom/waiqin365/lightapp/kehu/CMContactActivity;

    const/16 v2, 0x71

    invoke-virtual {v1, v0, v2}, Lcom/waiqin365/lightapp/kehu/CMContactActivity;->startActivityForResult(Landroid/content/Intent;I)V

    goto :goto_1
.end method
